// audio plugin
function SpawPGaudio()
{
}

SpawPGaudio.audioClick = function(editor, tbi, sender)
{
 if (tbi.is_enabled){   SpawEngine.openDialog('spawfm', 'spawfm', editor, '', 'type=audio', 'SpawPGaudio.audioClickCallback', null, null);
 }
}

SpawPGaudio.audioClickCallback = function(editor, result, tbi, sender)
{
	if(result){
		var pdoc = editor.getActivePageDoc();
		div = pdoc.createElement("div");
		div.setAttribute('class', 'audio');
		div.setAttribute('title', result);
		div.innerHTML = 'Аудио';
		editor.insertNodeAtSelection(div);
	}
	editor.updateToolbar();
}


SpawPGaudio.isAudioEnabled = function(editor, tbi)
{
  return editor.isInDesignMode();
}
